﻿// ***********************************************************************
// Assembly         : CtrLayer
// Author           : Kristian
// Created          : 05-12-2014
//
// Last Modified By : Kristian
// Last Modified On : 05-12-2014
// ***********************************************************************

using DBLayer.Datacontext;
using ModelLayer;
using System.Collections.Generic;

namespace CtrLayer
{
    /// <summary>
    /// Interface ICtrUser
    /// </summary>
    public interface ICtrUser
    {
        /// <summary>
        /// Creates the user.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns><c>true</c> if the user is created in the database, <c>false</c> otherwise.</returns>
        int CreateUser(User user);

        /// <summary>
        /// Gets a use in the database with a given userId.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <returns>DBUser if found, null otherwise</returns>
        User GetUser(int userId);

        /// <summary>
        /// Gets the user.
        /// </summary>
        /// <param name="userEmail">The user email.</param>
        /// <returns>DBUser if found, null otherwise</returns>
        User GetUser(string userEmail);

        /// <summary>
        /// Gets the user.
        /// </summary>
        /// <param name="userEmail">The user email.</param>
        /// <param name="userPassword">The user password.</param>
        /// <returns>DBUser if found, null otherwise</returns>
        User GetUser(string userEmail, string userPassword);

        List<User> GetFriendships(User user);

        List<Friend> GetPendingFriendships(User user);

        int RequestFriendship(User requester, User requested);

        List<User> SearchUserList(string[] keywords);

        int SetFriendshipStatus(User requester, User accepter, Friend.Status status);

        int DeleteUsers(int[] userIDs);
    }
}